import { reqGetAlbumList } from '@/api/album'
import { GET_ALBUM_LIST } from './album'

// vuex模块
export default {
  namespaced: true,
  // 定义管理的数据名
  state: {
    albumList: {}
  },
  //
  actions: {
    async getAlbumList({ commit }) {
      let follow = await reqGetAlbumList()
      // console.log(follow)
      commit('GET_ALBUM_LIST', follow)
    }
  },
  // 触发mutations更新数据
  mutations: {
    [GET_ALBUM_LIST](state, follow) {
      state.albumList = follow.albums
    }
  }
}
